package lianxi;

import java.util.HashMap;
import java.util.Map;

public class YangHuiSanJiaoXing {

	public static void main(String[] args) {
		Map<Integer, int[]> map = new HashMap<Integer, int[]>();
		int[] list = new int[] { 1, 1 };
		map.put(1, new int[] { 1 });
		map.put(2, new int[] { 1, 1 });
		int s = 3;
		for (int i = 3; i <= 7; i++) {
			int[] list1 = new int[i];
			for (int j = 0; j < i; j++) {
				if (j == 0 || j == i - 1) {
					list1[j] = 1;
					continue;
				}
				list1[j] = list[j] + list[j - 1];// 杨慧三角形运算规律
			}
			map.put(s++, list1);// 存放新的键值对
			list = list1;
		}
		for (int i = 1; i <= 7; i++) {//遍历取出数组元素
			int[] a = (int[]) map.get(i);
			for (int j = 0; j < a.length; j++) {
				System.out.print(a[j] + " ");
			}
			System.out.println();
		}
	}
}